<?php
/**
 * @file outsourcepublicnum.php
 * @author LinLin
 * @date 2016年8月11日 下午7:00:05
 * @brief 
 */
namespace haibao\weixin\data;

class OutSourcePublicNum extends \haibao\weixin\data\BaseMysql{
    public function __construct() {
        parent::__construct ( '\haibao\weixin\model\data\OutSourcePublicNum' );
    }

    public function getOutSourceEditor(){
        $sql = 'select * from OutSourceEditor';
        $result = $this->query($sql);
        $outSourceInfo = array();
        while($row = $result->fetch_assoc()){
            $outSourceInfo[] = $row;
        }
        return $outSourceInfo;
    }

    public function saveOutSourceEditor($model){
        if($model->Id){
            $this->save($model);
        }else{
            $this->add($model);
        }
        return $model->Id;
    }


    public function getAllOutSourceEditorId(){
        $sql = 'select Id from OutSourceEditor';
        $result = $this->query($sql);
        $idArr = array();
        while($row = $result->fetch_assoc()){
            $idArr[] = $row['Id'];
        }
        return $idArr;
    }

} 